import request from '@/utils/request'

// 获取菜单数据
export function getListMenus() {
  return request({
    url: '/System/table/menus',
    method: 'get'
  })
}

// 获取菜单数据
export function getSelectTree() {
  return request({
    url: '/System/select/tree/menus',
    method: 'get'
  })
}

// // 更具roleId获取菜单数据
// export function getSelectTreeByroleId(roleId) {
//   return request({
//     url: '/System/select/tree/eidtMenus/'+roleId,
//     method: 'get'
//   })
// }

// 更具roleId获取菜单数据
export function getMenusIds(roleId) {
  return request({
    url: '/System/menusId/'+roleId,
    method: 'get'
  })
}



export function doAdd(data) {
  return request({
    url: '/System/menus',
    method: 'post',
    data,
  })
}

export function doEdit(data) {
  return request({
    url: '/System/menus',
    method: 'put',
    data,
  })
}

export function doDelete(id) {
  return request({
    url: `/System/menus/${id}`,
    method: 'delete'
  })
}
